import Vue from 'vue'

const prefix = {
  320500: 'sz-',
  310100: 'sh-'
}

export default ({ store }) => {
  // 判断苏州还是上海进行跳转不同的页面
  function link(options) {
    const { name } = options
    const { region_code } = store.state.city
    options.name = ((prefix[region_code] || 'sz-') + name).replace('-index', '')
    return options
  }
  Vue.prototype.$link = link
}
